using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace NameSpace
{
    public partial class ClientUC : UserControl
    {
        #region Public Properties
        public string Label
        {
            get
            {
                return lblClient.Content.ToString();
            }
            set
            {
                lblClient.Content = value;
            }
        }

        public List<object> ItemsSource
        {
            get
            {
                return cboClient.ItemsSource.Cast<object>().ToList();
            }
            set
            {
                cboClient.ItemsSource = value;
            }
        }

        public object SelectedItem
        {
            get
            {
                return cboClient.SelectedItem;
            }
            set
            {
                cboClient.SelectedItem = value;
            }
        }

        public object SelectedValue
        {
            get
            {
                return cboClient.SelectedValue;
            }
            set
            {
                cboClient.SelectedValue = value;
            }
        }

        public string DisplayMemberPath
        {
            get
            {
                return cboClient.DisplayMemberPath;
            }
            set
            {
                cboClient.DisplayMemberPath = value;
            }
        }

        public string SelectedValuePath
        {
            get
            {
                return cboClient.SelectedValuePath;
            }
            set
            {
                cboClient.SelectedValuePath = value;
            }
        }
        
        #endregion

        #region Delegates and Events
        public delegate void OnComboBoxSelectionChangedEventHandler(object sender, SelectionChangedEventArgs e);
        public event OnComboBoxSelectionChangedEventHandler OnSelectionChanged;
        #endregion

        public ClientUC()
        {
            InitializeComponent();
            //COMMENT : Old method, replaced with private void cboClient_SelectionChanged
			//cboClient.SelectionChanged+= OnSelectionChanged(this,new SelectionChangedEventArgs(new RoutedEvent(),null,null));
        }

		private void cboClient_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            OnSelectionChanged(sender, e);
        }
    }
}

